package exam.bak.E58;

import java.util.Random;
import java.util.Set;
import java.util.TreeSet;

public class P2 {

    public int[] rec(int[][] results) {
        Set<Integer> set = new TreeSet<Integer>();
        for (int[] result : results) {
            for (int r : result) {
                set.add(r);
            }
        }
        int[] result = new int[set.size()];
        int i = set.size() - 1;
        for (int r : set) {
            result[i] = r;
            i--;
        }
        return result;
    }


    public static void main(String[] args) {
        int[][] results = new int[][]{
                // {1, 3, 2}, {4, 5, 6}, {9, 8, 7}
        };
        int[] rec = new P2().rec(results);
        Set<Integer> set = new TreeSet<>();
        for (int i = 0; i < 100; i++) {
            set.add(new Random().nextInt(1000));
        }
        for (int s : set) {
            System.out.println(s);
        }

    }
}
